<!--
    Desenvolvido pela Fábrica de Software do CESUPA.
    Todos os direitos reservados.

    @author Breno Leite
-->

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:appcommons="http://www.fabsoft.cesupa.br/appcommons">

    <ui:composition template="help-template.xhtml">
        <ui:param name="showrelatedtopics" value="false"/>
        <ui:param name="showsectionssummary" value="false"/>

        <ui:param name="pagetitle" value="#{messages.SearchResults}"/>
        <ui:param name="pageicon" value="#{facesContext.externalContext.request.contextPath}/images/icons/page-16x16.gif"/>
        <ui:param name="pagekeywords" value="resultados, hints"/>
        <ui:param name="pagedescription" value="Exibição dos resultados de pesquisa nos tópicos de ajuda"/>

        <ui:define name="controls">
            <div style="padding:5px;">
                #{messages.SearchResultFor} <b>#{SessionBean.searchQuery}</b>.<br/>
                #{messages.ResultsFound}: #{HelpSearchResultBean.searchResultsLength}. #{messages.TotalTime}: #{HelpSearchResultBean.searchTime} milisegundos.
            </div>
        </ui:define>

        <ui:define name="help-content">
            <h:form>
                <rich:dataList id="results-list" var="searchResult"
                               value="#{HelpSearchResultBean.searchResults}" rows="2"
                               style="list-style:none;padding:0px;">
                    <div class="search-result">
                        <span class="search-result-title">
                            <a href="#{facesContext.externalContext.request.contextPath}#{searchResult.relatedHelpTopic.path}">#{searchResult.relatedHelpTopic.title}</a>
                        </span><br/>
                        <div class="search-result-description">
                            #{searchResult.relatedHelpTopic.description}<br/>
                            <span style="font-size:x-small;">Palavras-chave relacionadas: #{searchResult.relatedHelpTopic.keywords}<br/>
                                <span style="color:green;">Relevância: #{searchResult.score}</span></span>
                        </div>
                    </div>
                </rich:dataList>
                <rich:datascroller for="results-list" maxPages="20" id="sc2"/>
            </h:form>
        </ui:define>
    </ui:composition>
</html>